package com.xueke.crawler.dao;

import com.xueke.crawler.model.DocInfo;
import com.xueke.crawler.model.DocRelation;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * Created by weibo on 2017/5/13.
 *
 * @author weibo.qin
 * @version 2017/5/13
 */
@Mapper
public interface DocInfoMapper {


    @Insert("INSERT INTO `tbl_xueke_info_2016` " +
        "(`auditUser`, `dateTime`, `description`, `docClass`, `docName`, `docType`, `docVersion`, `downLevel`, `downUrl`, `fileAfterName`, `fileSize`, `groupId`, `infoArea`, `infoYear`, `jifen`," +
        " `lastProcessDate`, `pathName`, `price`, `status`, " +
        "`upUser`, `downSeq`, `downTimes`, `back1`, `back2`) VALUES " +
        "(#{auditUser}, #{dateTime}, #{description}, #{docClass}, #{docName}, #{docType}, #{docVersion}, " +
        "#{downLevel}, #{downUrl}, #{fileAfterName}, #{fileSize}, #{groupId}, #{infoArea}, #{infoYear}, #{jifen}, " +
        "#{lastProcessDate}, #{pathName}, #{price}, #{status}, " +
        "#{upUser}, #{downSeq}, #{downTimes}, #{back1}, #{back2})")
    public void insertDocInfo(DocInfo docInfo);

    @Select("select  docClass from tbl_xueke_info_2016 where status=1 limit #{start},#{offset}")
    public List<String> queryDownloadedDocClass(@Param ("start") int start ,@Param("offset") int offset);
    
    @Select("select  docClass from tbl_xueke_info_2016  limit #{start},#{offset}")
    public List<String> queryFilledInfoDocClass(@Param ("start") int start ,@Param("offset") int offset);
}
